/*
 * Copyright (C) 2017 The MoonLake Authors
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */


package com.minecraft.moonlake.legendaryweaponrel.weapons.potion;

import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerItemConsumeEvent;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;

public class Tune extends WeaponAbstractPotionBase {

    public Tune() {
        super("tune", "&b润滑油", Material.POTION);
    }

    @Override
    public String[] getLore() {
        return new String[] {
                "&7喝下后获得&a速度、跳跃3 15s &7效果"
        };
    }

    @Override
    protected void onUsePotion(PlayerItemConsumeEvent event, Player player) {
        // 处理药水使用
        player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 15 * 20, 2));
        player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 15 * 20, 2));
        player.playSound(player.getLocation(), Sound.BURP, 10f, 1f);
    }
}
